package com.aaa.ssm.controller;

import com.aaa.ssm.pojo.dto.Grade;
import com.aaa.ssm.result.AjaxResult;
import com.aaa.ssm.service.GradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("grade")
public class GradeController {
    @Autowired
    private GradeService gradeService;
    @RequestMapping("list")
    public AjaxResult list(){
        try {
            List<Grade> grades = gradeService.listAllGrade();
            return AjaxResult.success(grades);
        }catch (Exception e){
            e.printStackTrace();
            return AjaxResult.error(e.getMessage());
        }
    }
}
